package com.mlk.activity.controller;

import com.mlk.activity.service.EngActivityService;
import com.mlk.core.component.page.Pager;
import com.mlk.core.util.ServerResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * 活动
 */
@Controller
@RequestMapping("/eng/activity")
public class EngActivityController {

    @Resource
    private EngActivityService engActivityService;

    /**
     *返回首页
     * @return
     */
    @RequestMapping("index")
    public String index(){
        return "engActivity/activity";
    }

    /**
     * 活动信息展示
     * @return
     */
    @ResponseBody
    @RequestMapping("listPage")
    public Pager listPage(){
        return this.engActivityService.listPage();
    }

    /**
     * 修改活动信息
     */

    @ResponseBody
    @RequestMapping("update")
    public ServerResponse updateActivity(Integer id,String name,String content){
        return this.engActivityService.updateActivity(id,name,content);
    }
}
